package com.email.service.impl;

import java.io.UnsupportedEncodingException;

import javax.mail.MessagingException;
import javax.mail.internet.AddressException;

import org.springframework.stereotype.Service;

import com.email.entity.MailUtil;
import com.email.entity.Message;
import com.email.service.MessagePushSevice;

@Service
public class EmailMessagePushSeviceImpl implements MessagePushSevice{

    public String send(Message message){
        try{
        	MailUtil.sendMail(message);
        } catch(AddressException e) {
            e.printStackTrace();
        } catch(MessagingException e) {
            e.printStackTrace();
        } catch(UnsupportedEncodingException e){
            e.printStackTrace();
        }
        
        return "send success";
    }
}
